package com.buchong.controller;


import com.buchong.pojo.User;
import com.buchong.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;


    @RequestMapping("/show")
    public String show(@RequestParam(required = false,defaultValue = "1") Integer id, Model model){
        User one = userService.findOne(id);
        model.addAttribute("user",one);
        return "信息";
    }


}
